<pre>{{clazz | json}}</pre>
<form class="container-sm" (ngSubmit)="onSubmit()">
  <div class="mb-3 row">
    <label for="name" class="col-sm-2 col-form-label">名称</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" [(ngModel)]="clazz.name" name="name" id="name">
      <small class="text-danger"
             *ngIf="clazz.name === ''">
        班级名称不能为空
      </small>
    </div>
  </div>
  <div class="mb-3 row">
    <label class="col-sm-2 col-form-label">班主任</label>
    <div class="col-sm-10">
      <app-klass-select (beChange)="onTeacherChange($event)"></app-klass-select>
      <small class="text-danger"
             *ngIf="clazz.teacherId === null">
        必须指定一个班主任
      </small>
    </div>
  </div>
  <div class="mb-3 row">
    <div class="col-sm-10 offset-2">
      <button class="btn btn-primary"
              [disabled]="clazz.name === '' || clazz.teacherId === null">保存
      </button>
    </div>
  </div>
</form>

